package com.tico.common.webResponse;

import lombok.Data;

//@Builder.Default
@Data
public class WebResponse<T> {
    private boolean success = true;
    private String err_code = "0";
    private String err_msg = "";
    private T data;

    /**
     * 默认成功
     */
    public WebResponse() {
    }

    public WebResponse(String err_msg) {
        this.err_msg = err_msg;
    }

    /**
     * 成功
     */
    public WebResponse(T data) {
        this.data = data;
    }

    public WebResponse(String err_code, String err_msg) {
        this.err_code = err_code;
        this.err_msg = err_msg;
    }

    public WebResponse(boolean success, String err_code, String err_msg) {
        this.success = success;
        this.err_code = err_code;
        this.err_msg = err_msg;
    }

    public WebResponse(boolean success, String err_code, String err_msg, T data) {
        this.success = success;
        this.err_code = err_code;
        this.err_msg = err_msg;
        this.data = data;
    }
}
